import request from '@/utils/request'

export function getList(params) {
  return request({
    url: '/users',
    method: 'get',
    params
  })
}
export function create(params) {
  return request({
    url: '/users',
    method: 'post',
    data: params
  })
}

export function update(id, params) {
  return request({
    url: '/users/' + id,
    method: 'put',
    data: params
  })
}

export function show(id) {
  return request({
    url: '/users/' + id,
    method: 'get'
  })
}

export function del(id) {
  return request({
    url: '/users/' + id,
    method: 'delete'
  })
}

export function resetPassword(id, password) {
  return request({
    url: '/users/' + id + '/password',
    method: 'put',
    data: {
      password: password
    }
  })
}
